//
//  FollowWxController.m
//  LiquorChain
//
//  Created by apple on 2018/12/27.
//  Copyright © 2018年 王冬. All rights reserved.
//

#import "FollowWxController.h"

@interface FollowWxController ()

@end

@implementation FollowWxController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"关注微信公众号";
    self.view.backgroundColor =[UIColor whiteColor];
    UIView *backView =[[UIView alloc]initWithFrame:CGRectMake(0, kNavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT- kNavBarHeight - kIPhoneXBottomHeight)];
    backView.backgroundColor = RGBA(21.0, 0, 38.0, 1);
    [self.view addSubview:backView];
    UILabel *heabLabel =[[UILabel alloc]init];
    [backView addSubview:heabLabel];
    heabLabel.text = @"按照如下步骤";
    heabLabel.textColor = [UIColor whiteColor];
    heabLabel.textAlignment = NSTextAlignmentCenter;
    heabLabel.font =[UIFont systemFontOfSize:25];
    [heabLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo (40);
        make.left.mas_equalTo(76);
        make.right.mas_equalTo(-76);
        make.height.mas_equalTo(29);
        
    }];
    UILabel *headsLabel =[[UILabel alloc]init];
    [backView addSubview:headsLabel];
    headsLabel.font = [UIFont systemFontOfSize:25];
    headsLabel.textAlignment = NSTextAlignmentCenter;
    headsLabel.textColor =[UIColor whiteColor];
    headsLabel.text = @"完成关注微信公众号";
    [headsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(heabLabel.mas_bottom).with.offset(5);
        make.left.mas_equalTo(heabLabel.mas_left);
        make.right.mas_equalTo(heabLabel.mas_right);
        make.height.mas_equalTo(29);
    }];

    UIImageView *backImageView =[[UIImageView alloc]init];
    [backView addSubview:backImageView];
    backImageView.backgroundColor = RGBA(206.0, 18.0, 87.0, 1);
    backImageView.layer.cornerRadius = 15;
    [backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(headsLabel.mas_bottom).with.offset(11);
        make.left.mas_equalTo(headsLabel.mas_left).with.offset(-6);
        make.right.mas_equalTo(headsLabel.mas_right).with.offset(-6);
        make.height.mas_equalTo(30);
    }];
    NSString *numStr =[NSString stringWithFormat:@"即可领取%d%@",5,@"个酿力"];
    NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc]initWithString:numStr];
    [attStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(0, attStr.length)];
    [attStr addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, attStr.length)];
    [attStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:17] range:NSMakeRange(4, 1)];
    [attStr addAttribute: NSForegroundColorAttributeName value:[UIColor yellowColor] range:NSMakeRange(4, 1)];
   
    UILabel *numLabel =[[UILabel alloc]init];
    [backImageView addSubview:numLabel];
    numLabel.attributedText = attStr;
    numLabel.textAlignment = NSTextAlignmentCenter;
    
    [numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.top.mas_equalTo (0);
        
    }];
    

    
    
    
    UIView *bodyView = [[UIView alloc]init];
    [backView addSubview:bodyView];
    bodyView.backgroundColor =[UIColor whiteColor];
    bodyView.layer.cornerRadius = 5;
    [bodyView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(backImageView.mas_bottom).with.offset(38);
        make.left.mas_equalTo(23);
        make.right.mas_equalTo(-23);
        make.height.mas_equalTo(320);
    }];
    UILabel *showLabel =[[UILabel alloc]init];
    [bodyView addSubview:showLabel];
    showLabel.text = @"请输入6位验证码";
    showLabel.font =[UIFont systemFontOfSize:24];
    showLabel.textAlignment = NSTextAlignmentCenter;
    [showLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(48);
        make.left.mas_equalTo(75);
        make.right.mas_equalTo(-75);
        make.height.mas_equalTo(23);
    }];
    UITextField  *numberFiled =[[UITextField alloc]init];
    numberFiled.layer.cornerRadius = 5;
    numberFiled.textAlignment = NSTextAlignmentCenter;
    numberFiled.font = [UIFont systemFontOfSize:24];
    numberFiled.backgroundColor = RGBA(238.0, 238.0, 238.0, 1);
    [bodyView addSubview:numberFiled];
    [numberFiled mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(showLabel.mas_bottom).with.offset(22);
        make.left.mas_equalTo(showLabel.mas_left).with.offset(-36);
        make.right.mas_equalTo(showLabel.mas_right).with.offset(36);
        make.height.mas_equalTo(45);
    }];
    UIButton *commitBtn =[UIButton buttonWithType:UIButtonTypeCustom];
    [bodyView addSubview:commitBtn];
    commitBtn.backgroundColor = CUSTOMCOLOR;
    commitBtn.layer.cornerRadius = 20;
    [commitBtn setTitle:@"确定" forState:UIControlStateNormal];
    [commitBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [commitBtn addTarget:self action:@selector(commitClick:) forControlEvents:UIControlEventTouchUpInside];
    [commitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(numberFiled.mas_bottom).with.offset(50);
        make.left.mas_equalTo(numberFiled.mas_left).with.offset(-14);
        make.right.mas_equalTo(numberFiled.mas_right).with.offset(14);
        make.height.mas_equalTo(40);
    }];
    UILabel *warnLabel =[[UILabel alloc]init];
    [bodyView addSubview:warnLabel];
    warnLabel.textAlignment = NSTextAlignmentCenter;
    warnLabel.textColor = RGBA(136, 136, 136, 1);
    warnLabel.text = @"每个酒链用户仅有一次领取机会";
    warnLabel.font =[UIFont systemFontOfSize:11];
    [warnLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(commitBtn.mas_bottom).with.offset(22);
        make.left.mas_equalTo(commitBtn.mas_left).with.offset(63);
        make.right.mas_equalTo(commitBtn.mas_right).with.offset(-63);
        make.height.mas_equalTo(11);
    }];
    
}
-(void)commitClick:(UIButton *)sender{
    NSLog(@"123");
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
